﻿<UserControl x:Class="CustomControls.CircularButton.CircularLockToggleButton"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    <UserControl.Resources>
        <Style x:Key="CurcularToggleButtonStyle" BasedOn="{x:Null}" TargetType="{x:Type ToggleButton}">
            <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
            <Setter Property="HorizontalContentAlignment" Value="Center"/>
            <Setter Property="VerticalContentAlignment" Value="Center"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type ToggleButton}">
                        <Grid>
                            <Path HorizontalAlignment="Center" x:Name="path" VerticalAlignment="Center" Width="{TemplateBinding Width}" Height="{TemplateBinding Height}" Fill="{TemplateBinding Background}" Stretch="Fill" Stroke="{TemplateBinding BorderBrush}" StrokeThickness="1">
                                <Path.Data>
                                    <PathGeometry>
                                        <PathFigure IsClosed="True" StartPoint="149,17.5">
                                            <BezierSegment Point1="149,26.8888407471235" Point2="115.757142674936,34.5" Point3="74.75,34.5" IsSmoothJoin="True"/>
                                            <BezierSegment Point1="33.7428573250636,34.5" Point2="0.5,26.8888407471235" Point3="0.5,17.5" IsSmoothJoin="True"/>
                                            <BezierSegment Point1="0.5,8.11115925287651" Point2="33.7428573250636,0.5" Point3="74.75,0.5" IsSmoothJoin="True"/>
                                            <BezierSegment Point1="115.757142674936,0.5" Point2="149,8.11115925287651" Point3="149,17.5" IsSmoothJoin="True"/>
                                        </PathFigure>
                                    </PathGeometry>
                                </Path.Data>
                            </Path>
                            <ContentPresenter x:Name="contentHolder" Margin="-3" HorizontalAlignment="Center" VerticalAlignment="Center" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" RecognizesAccessKey="True"/>
                            <Border BorderThickness="2" Width="{TemplateBinding Width}" Height="{TemplateBinding Height}" CornerRadius="27.5" Background="Transparent">
                                <Border.BorderBrush>
                                    <LinearGradientBrush EndPoint="0.504,1.5" StartPoint="0.504,0.03">
                                        <GradientStop Color="Black" Offset="0"/>
                                        <GradientStop Color="Gainsboro" Offset="0.2967"/>
                                    </LinearGradientBrush>
                                </Border.BorderBrush>
                            </Border>
                        </Grid>                        
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </UserControl.Resources>
    <ToggleButton x:Name="CommandToggleButton" Width="55" FontSize="40"  Height="55" Visibility="Visible" BorderBrush="#7FFFFFFF" Checked="CommandToggleButton_Checked" Unchecked="CommandToggleButton_Unchecked" FontWeight="Bold" Foreground="#FFFFFFFF" Style="{StaticResource CurcularToggleButtonStyle}" HorizontalAlignment="Center" VerticalAlignment="Center">
        <ToggleButton.RenderTransform>
            <TransformGroup>
                <ScaleTransform/>
                <SkewTransform/>
                <RotateTransform/>
                <TranslateTransform/>
            </TransformGroup>
        </ToggleButton.RenderTransform>
    </ToggleButton>
</UserControl>
